package com.iflysse.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.iflysse.service.StudentTestService;
import com.iflysse.vo.AjaxResult;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
@Api(tags = { "学生测试接口" })
@RestController
@RequestMapping("/studentTest")
public class StudentTestController {
	@Autowired
	private StudentTestService studentTestService;
	@ApiOperation(value = "剩余测试数")
	@ApiImplicitParams({
		@ApiImplicitParam(paramType = "query", name = "studentId", dataType = "String", required=true, value="学生ID"), 
		@ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "Integer", required=false, value="每页大小默认10"), 
		@ApiImplicitParam(paramType = "query", name = "pageIndex", dataType = "Integer", required=false, value="默认显示第1页")
	})
	@PostMapping("/queryTestCount")
	public Object getStudentTestCount(String studentId,
			@RequestParam(defaultValue = "1") Integer pageIndex,
			@RequestParam(defaultValue = "10")Integer pageSize) {		
		return AjaxResult.success(studentTestService.getStudentTestCount(studentId, pageIndex, pageSize));
	}
}
